<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="">
		<meta name="author" content="">

		<title>Dashboard Template for Bootstrap</title>
		<!-- Bootstrap core CSS -->
		<link href="asserts/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/4.0.0/css/bootstrap.css}" rel="stylesheet">

		<!-- Custom styles for this template -->
		<link href="asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
		<style type="text/css">
			/* Chart.js */
			
			@-webkit-keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}
			
			@keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}
			
			.chartjs-render-monitor {
				-webkit-animation: chartjs-render-animation 0.001s;
				animation: chartjs-render-animation 0.001s;
			}

			th {
				text-align: center;
			}
			td{
				text-align: center;
			}

		</style>
	</head>

	<body>
		<!--引入抽取的topbar-->
		<!--模板名：会使用thymeleaf的前后缀配置规则进行解析-->
		<div th:replace="commons/bar::topbar"></div>

		<div class="container-fluid">
			<div class="row">
				<!--引入侧边栏-->
				<div th:replace="commons/bar::#sidebar(activeUri='processInstance')"></div>
				<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
					<form class="form-horizontal required-validate" th:action="@{/processInstance/redeploySingle}" enctype="multipart/form-data" method="post">

						<div class="btn-group">
							<div class="col-md-10 tl th">
								<input type="file" name="file" class="projectfile"/>
								<p class="help-block">支持jpg、jpeg、png、gif格式，大小不超过2.0M</p>
								<button type="submit" class="btn btn-primary btn-sm">提交</button>
							</div>
						</div>
					</form>

					<div class="table-responsive">
						<table class="table table-bordered table-striped table-sm" style="width: 100%;height: auto">
							<thead>
								<tr>
									<th>流程定义ID</th>
									<th>部署ID</th>
									<th>名称</th>
									<th>key</th>
									<th>版本号</th>
									<th>XML</th>
									<th>图片</th>
									<th>部署时间</th>
									<th>是否挂起</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<tr th:each="process:${processInstances}">
									<td th:text="${process.id}"></td>
									<td th:text="${process.deploymentId}"></td>
									<td th:text="${process.name}"></td>
									<td th:text="${process.key}"></td>
									<td th:text="${process.version}"></td>
									<td><a th:href="@{/processInstance/loadPic(processDefinitionId=${process.id},resourceType=xml)}">[[${process.resourceName}]]</td>
									<td><a th:href="@{/processInstance/loadPic(processDefinitionId=${process.id},resourceType=png)}">[[${process.diagramResourceName}]]</a></td>
									<td th:text="${#dates.format(process.deploymentTime,'yyyy-MM-dd HH:mm')}"></td>
									<!--点击事件，获取value进行判断处理 -->
									<td><a th:href="@{/processInstance/editStatus(status=${process.suspended},pdid=${process.id})}">[[${process.suspended} == false ? '激活':'挂起']]</a></td>
									<!--th:onclick方法有待研究-->
									<!--<td><a href="#" th:onclick="'javascript:editStatus('+${process.suspended}+','${process.id}+')">[[${process.suspended} == false ? '激活':'挂起']]</a></td>-->
									<td>
										<button th:attr="del_uri=@{/processInstance/deleteProcessInstance/}+${process.deploymentId}" class="btn btn-sm btn-danger deleteBtn">删除</button>&nbsp&nbsp
										<a class="btn btn btn-warning" th:href="@{/processInstance/convert_to_model(processDefinitionId=${process.id})}">转换为Model</a>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</main>
				<form id="deleteEmpForm"  method="post">
					<input type="hidden" name="_method" value="delete"/>
				</form>
			</div>
		</div>

		<!-- Bootstrap core JavaScript
    ================================================== -->
		<!-- Placed at the end of the document so the pages load faster -->
		<script type="text/javascript" src="asserts/js/jquery-3.2.1.slim.min.js" th:src="@{/webjars/jquery/3.3.1/jquery.js}"></script>
		<script type="text/javascript" src="asserts/js/popper.min.js" th:src="@{/webjars/popper.js/1.11.1/dist/popper.js}"></script>
		<script type="text/javascript" src="asserts/js/bootstrap.min.js" th:src="@{/webjars/bootstrap/4.0.0/js/bootstrap.js}"></script>
		<script type="text/javascript" src="asserts/js/app/productTable.js" th:src="@{/asserts/js/app/processInstance.js}"></script>
		<!-- Icons -->
		<script type="text/javascript" src="asserts/js/feather.min.js" th:src="@{/asserts/js/feather.min.js}"></script>
		<script>
			feather.replace()
		</script>
		<script>
			$(".deleteBtn").click(function(){
			    //删除当前员工的
			    $("#deleteEmpForm").attr("action",$(this).attr("del_uri")).submit();
			    return false;
            });
		</script>

	</body>
</html>